import {
  UploadOutlined 
} from '@ant-design/icons';

import { Index as Home } from '../views/home/Index'

import { Index as Banner } from '../views/banner/Index'
import { List as BannerList } from '../views/banner/List'
import { Active as BannerActive } from '../views/banner/Active'
import { Add as BannerAdd } from '../views/banner/Add'

import { Index as Pro } from '../views/pro/Index'
import { List as ProList } from '../views/pro/List'
import { Search as ProSerach } from '../views/pro/Search'

import { Index as Account } from '../views/user/Index'
import { UserList } from '../views/user/UserList'
import { AdminList } from '../views/user/AdminList'

import { Setting } from '../views/set/Setting'

import { List as Cart } from '../views/cart/Index'

import DataIndex from '../views/data/Index';
import ECharts from '../views/data/Echarts';
import Highcharts from '../views/data/HighCharts'
import Antv from '../views/data/Antv';

import { Index as Editor } from '../views/editor/Index'
import { Braft  } from '../views/editor/Braft'
import { MarkDown } from '../views/editor/MarkDown'

import { Index as Excel } from '../views/excel/Index'
import { Import  } from '../views/excel/Import'
import { Export } from '../views/excel/Export'

import { Baidu } from '../views/map/Baidu'

export interface IMenuProps  {
  keyId: string
  label: string
  icon?: React.ReactNode
  key: string
  children?: IMenuProps[],
  element: React.ReactNode,
  index?: boolean,
  hidden?: boolean
}

const menus: IMenuProps[] = [
  {
    keyId: '0-0',
    label: '系统首页',
    icon: <UploadOutlined  />,
    key: '/', // 需要跳转的链接其实就是唯一表示
    element: <Home />
  },
  {
    keyId: '0-1',
    label: '轮播图管理',
    icon: <UploadOutlined  />,
    key: '/banner', 
    element: <Banner />,
    children: [
      {
        keyId: '0-1-0',
        index: true,
        label: '首页轮播图',
        icon: <UploadOutlined  />,
        key: '/banner/home',
        element: <BannerList />,
      },
      {
        keyId: '0-1-1',
        label: '活动页轮播图',
        icon: <UploadOutlined  />,
        key: '/banner/active',
        element: <BannerActive />
      },
      {
        keyId: '0-1-2',
        index: true,
        label: '添加轮播图',
        icon: <UploadOutlined  />,
        key: '/banner/add',
        element: <BannerAdd />,
        hidden: true
      },
    ]
  },
  {
    keyId: '0-2',
    label: '产品管理',
    icon: <UploadOutlined  />,
    key: '/pro', 
    element: <Pro />,
    children: [
      {
        keyId: '0-2-0',
        index: true,
        label: '产品列表',
        icon: <UploadOutlined  />,
        key: '/pro/list',
        element: <ProList />,
      },
      {
        keyId: '0-2-1',
        label: '筛选列表',
        icon: <UploadOutlined  />,
        key: '/pro/search',
        element: <ProSerach />
      }
    ]
  },
  {
    keyId: '0-3',
    label: '账户管理',
    icon: <UploadOutlined  />,
    key: '/account', 
    element: <Account />,
    children: [
      {
        keyId: '0-3-0',
        index: true,
        label: '用户列表',
        icon: <UploadOutlined  />,
        key: '/account/userlist',
        element: <UserList />
      },
      {
        keyId: '0-3-1',
        label: '管理员列表',
        icon: <UploadOutlined  />,
        key: '/account/adminlist',
        element: <AdminList />
      }
    ]
  },
  {
    keyId: '0-4',
    label: '购物车管理',
    icon: <UploadOutlined  />,
    key: '/cart',
    element: <Cart />
  },
  {
    keyId: '0-5',
    label: '设置',
    icon: <UploadOutlined  />,
    key: '/setting',
    element: <Setting />,
    hidden: true
  },
  {
    keyId: '0-6',
    label: '数据可视化',
    icon: <UploadOutlined  />,
    key: '/data',
    element: <DataIndex />,
    children: [
      {
        index: true,
        keyId: '0-6-0',
        label: 'ECharts',
        icon: <UploadOutlined  />,
        key: '/data/echarts',
        element: <ECharts />,
      },
      {
        keyId: '0-6-1',
        label: 'Highcharts',
        icon: <UploadOutlined  />,
        key: '/data/highcharts',
        element: <Highcharts />,
      },
      {
        keyId: '0-6-2',
        label: 'Antv',
        icon: <UploadOutlined  />,
        key: '/data/antv',
        element: <Antv />,
      }
    ]
  },
  {
    keyId: '0-7',
    label: '编辑器',
    icon: <UploadOutlined  />,
    key: '/editor',
    element: <Editor />,
    children: [
      {
        index: true,
        keyId: '0-7-0',
        label: '富文本编辑器',
        icon: <UploadOutlined  />,
        key: '/editor/braft',
        element: <Braft />,
      },
      {
        keyId: '0-7-1',
        label: 'markdown编辑器',
        icon: <UploadOutlined  />,
        key: '/editor/md',
        element: <MarkDown />,
      }
    ]
  },
  {
    keyId: '0-8',
    label: '导入以及导出',
    icon: <UploadOutlined  />,
    key: '/excel',
    element: <Excel />,
    children: [
      {
        index: true,
        keyId: '0-8-0',
        label: '导入',
        icon: <UploadOutlined  />,
        key: '/excel/import',
        element: <Import />,
      },
      {
        keyId: '0-8-1',
        label: '导出',
        icon: <UploadOutlined  />,
        key: '/excel/export',
        element: <Export />,
      }
    ]
  },
  {
    keyId: '0-9',
    label: '百度地图',
    icon: <UploadOutlined  />,
    key: '/baidumap',
    element: <Baidu />,
  }
]

export default menus